package com.xuan.selectcourse.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuan.selectcourse.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    //自定义查询用户权限
    List<User> findPermissionsByUsername(String username);

    //根据账号删除用户的所有角色
    void deleteRoleByUsername(String username);

    //新增教师或学生角色
    void addUserRole(@Param("uid") Integer uid,@Param("rid") Integer rid);

    //删除教师或学生角色
    void deleteUserRole(Integer id);

}
